﻿namespace EAL.Models
{
    using System;
    using System.Collections.ObjectModel;
    using System.ComponentModel.DataAnnotations;
    using EAL.Database;
using System.Collections.Generic;

    public class Order : ModelBase
    {
        private int _id;

        [Key]
        public int Id
        {
            get { return _id; }
            set 
            { 
                _id = value;
                this.OnPropertyChanged(() => this.Id);
            }
        }
        

        private DateTime _creationTime = DateTime.Today;
        public DateTime CreationTime
        {
            get { return _creationTime; }
            set 
            {
                _creationTime = value;
                this.OnPropertyChanged(() => this.CreationTime);
            }
        }

        private Customer _customer;
        public virtual Customer Customer
        {
            get
            {
                return _customer;
            }
            set
            {
                _customer = value;
                this.OnPropertyChanged(() => this.Customer);
            }
        }

        private PositionList _positions = new PositionList();
        public virtual PositionList Positions
        { 
            get
            {
                return _positions;
            }
            set
            {
                _positions = value;
                this.OnPropertyChanged(() => this.Positions);
            }
        }

        //enums aren't supported in this version of entity framework
        private String _state;
        public String State
        {
            get { return _state; }
            set 
            { 
                _state = value;
                this.OnPropertyChanged(() => this.State);
            }
        }

    }
}
